home *** CD-ROM | disk | FTP | other *** search
/ Geek Gadgets 2 / Geek_Gadgets_2_2352.bin / lists / ade-gcc.archive.9602.gz / ade-gcc.archive.9602 / 000062_owner-ade-gcc_Wed Feb 14 12:51:22 1996.msg < prev    next >
Internet Message Format  |  1996-02-28  |  4KB

  1. Return-Path: <owner-ade-gcc>
  2. Received: by fishpond (Smail3.1.29.1 #57)
  3.     id m0tmlL5-000gXYa; Wed, 14 Feb 96 12:49 EST
  4. Sender: owner-ade-gcc
  5. Received: from lysander.lysator.liu.se by fishpond with smtp
  6.     (Smail3.1.29.1 #57) id m0tmlAS-000gXUC; Wed, 14 Feb 96 12:39 EST
  7. Received: from tingeling.lysator.liu.se (nisse@tingeling.lysator.liu.se [130.236.253.25]) by lysander.lysator.liu.se (8.7.3/8.7.3) with ESMTP id RAA05980; Wed, 14 Feb 1996 17:14:43 +0100 (MET)
  8. Received: (from nisse@localhost) by tingeling.lysator.liu.se (8.7.3/8.7.3) id RAA25574; Wed, 14 Feb 1996 17:14:35 +0100 (MET)
  9. Date: Wed, 14 Feb 1996 17:14:35 +0100 (MET)
  10. Message-Id: <199602141614.RAA25574@tingeling.lysator.liu.se>
  11. From: "Niels M�ller" <nisse@lysator.liu.se>
  12. To: ADE GCC List <ade-gcc@amigalib.com>
  13. Cc: Kamil Iskra <kiskra@ernie.icslab.agh.edu.pl>
  14. In-reply-to: Kamil Iskra's message of Wed, 14 Feb 1996 12:27:25 +0100 (MET)
  15. Subject: Re: Passing arguments in registers - first attempt.
  16. MIME-Version: 1.0
  17. Content-type: text/plain; charset=iso-8859-1
  18. Content-transfer-encoding: 8bit
  19. References: <Pine.SUN.3.91.960214114852.12545A-100000@ernie>
  20. Sender: owner-ade-gcc@amigalib.com
  21. Precedence: bulk
  22.  
  23. Kamil Iskra <kiskra@ernie.icslab.agh.edu.pl> writes:
  24.  
  25. > I managed to implement passing arguments in registers using GCC 2.7.0. It
  26. > turned out to be very easy - GCC has full support for this. 
  27.  
  28. Nice
  29.  
  30. > 1. How to distinguish register calls from stack calls (i.e. how linker
  31. > should distinguish them)? 
  32.  
  33. I think it is a good idea to use a diffferent prefix for registerized
  34. entrypoints. for example @foo instead of _foo (is this how it is done
  35. in SAS C?). Then if you link incompatible objects, the linker will
  36. tell you about it, which is Good.
  37.  
  38. > 2.b. Like I did it, ie. two first integers in d0/d1, two first pointers in
  39. > a0/a1, rest on stack? 
  40.  
  41. I suspect that's the Right Way. There's probably not much gain using
  42. more registers for passing arguments.
  43.  
  44. > 2.c. Maybe we should use fp0/fp1 for floating point arguments? 
  45.  
  46. Sounds like a good idea.
  47.  
  48. > 2.d. Maybe there should be a default setting, which user can override by
  49. > specifieng "-mregparm=<number>", where number is (for example) amount of
  50. > register to use for each group of parameters (ie. 2 by default). 
  51.  
  52. I don't like this too much. Two incompatible calling conventions are
  53. enough. Don't add more of them.
  54.  
  55. > 3. How should library calls be made? Should there be two entries for each
  56. > function in every library? But this will result in worse code for stack
  57. > calls than currently. And how to implement it in IXEmul? 
  58.  
  59. There's two alternatives. Either generate two entry points for all
  60. library functions, or add some attributes to tell gcc to generate the
  61. correct call, no matter what convention is used for the rest of the
  62. call being compiled. I think I'd prefer the second alternative, is it
  63. possible to do?
  64.  
  65. > 4. I think that SAS/C compatible __stdargs and __regargs keywords should
  66. > be implemented. If the latter one was specified as GCC attribute, it would
  67. > be possible to provide <number> argument (see above), like this: 
  68.  
  69. > void func() __attribute__ ((regargs(3)));
  70.  
  71. I think that in most cases it's a bad idea to use any other number
  72. tnan the default 2. But of course it might be useful in some rare cases.
  73. How should the linker mark such functions?
  74.  
  75. void foo() __attribute__ ((stdargs));
  76. -> _foo
  77. void foo() __attribute__ ((regargs));
  78. -> @foo
  79. void foo() __attribute__ ((regargs(n))); /* n != 2*/
  80. -> @n@foo?
  81.  
  82. /Niels